package libra.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


/**
 * OpenFeign自身无法处理服务降级，需要配合Hystrix来处理
 * @author libra
 */
@Component
public class FeignInterFallbackFactory implements FallbackFactory<OpenFeignService> {
	@Override
	public OpenFeignService create(Throwable cause) {
		return new OpenFeignService() {
			@Override
			public Object list() {
				System.out.println("list");
				return null;
			}
			
			@Override
			public Object find(Integer id) {
				System.out.println("find");
				return null;
			}
			
			@Override
			public Object feignTimeOut() {
				System.out.println("feignTimeOut");
				return null;
			}
			
			@Override
			public Object create(String serial) {
				System.out.println("feignTimeOut");
				return null;
			}

			@Override
			public Object getParam(Object getParam) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Object postParam(Object postParam) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Object getPath(Object para) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Object postPath(Object para) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Object postJson(Map<String, Object> json) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Object postObj(Object obj) {
				// TODO Auto-generated method stub
				return null;
			}
		};
	}
}
